﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Bnoerj.AI.Steering;
using PloobsEngine.SceneControl;

namespace Etapa1.Pedestrian
{
    public class PathManager
    {
        public PathManager(List<Vector3> pathPoints, float pathRadius)
        {
            testPath = new PolylinePathway(pathPoints.Count,
                                                 pathPoints.ToArray(),
                                                 pathRadius,
                                                 false);
        }

        private PolylinePathway testPath = null;

        public PolylinePathway TestPath
        {
            get { return testPath; }            
        }

        public void AddCircularObstacle(Vector3 center, float radius)
        {
            SphericalObstacle so = new SphericalObstacle(radius, center);
            obstacles.Add(so);
        }

        public void AddCircularObstacle(IObject obj)
        {
            BoundingSphere bs = BoundingSphere.CreateFromBoundingBox(obj.PhysicObject.BoundingBox);
            SphericalObstacle so = new SphericalObstacle(bs.Radius, obj.Position);
            obstacles.Add(so);
        }

        private List<SphericalObstacle> obstacles = new List<SphericalObstacle>();

        public List<SphericalObstacle> Obstacles
        {
            get { return obstacles; }            
        }

    }
}
